import request from "@/utils/request";

/*
 * 用户统计及交易统计
 */
export function reportGetReportUserTrade(data) {
  return request({
    url: "/report/getReportUserTrade",
    method: "post",
    data,
  });
}
/*
 * 数据统计
 */
export function reportStatistics(params) {
  return request({
    url: "/report/statistics",
    method: "get",
    params,
  });
}

/*
 * 获取管理员列表
 */
// 更改为post，传body
export function adminGetOption(data) {
  return request({
    url: "admin/system/admin/getOption",
    method: "post",
    data,
  });
}

// 数据场管理
/*
 * 数据场全列表
 */
export function datafieldGetOption(data) {
  return request({
    url: "/datafield/getOption",
    method: "post",
    data,
  });
}
/*
 * 数据场列表
 */
export function datafieldList(params) {
  return request({
    url: "/datafield/list",
    method: "get",
    params,
  });
}
/*
 * 数据场新增
 */
export function datafieldSave(data) {
  return request({
    url: "/datafield/save",
    method: "post",
    data,
  });
}
/*
 * 数据场详情
 */
export function datafieldInfo(id) {
  return request({
    url: `/datafield/info/${id}`,
    method: "post",
  });
}
/*
 * 数据场编辑
 */
export function datafieldUpdate(data) {
  return request({
    url: "/datafield/update",
    method: "post",
    data,
  });
}
/*
 * 数据场删除
 */
export function datafieldDelete(data) {
  return request({
    url: "/datafield/delete",
    method: "post",
    data,
  });
}
/*
 * 导出数据场列表
 */
export function datafieldExport(params) {
  return request({
    url: "/datafield/export",
    method: "get",
    params,
  });
}
/*
 * 数据场迁移
 */
export function datafieldTransfer(data) {
  return request({
    url: "/datafield/transfer",
    method: "post",
    data,
  });
}

// 新首页统计
/*
 * 图形化统计
 */
export function indexIndexList(data) {
  return request({
    url: "/index/indexList",
    method: "post",
    data,
  });
}
/*
 * 数据场列表统计
 */
export function indexCommodityList(params) {
  return request({
    url: "/index/commodityList",
    method: "get",
    params,
  });
}

// 系统通告
/*
 * 系统通告列表
 */
export function annountCementList(params) {
  return request({
    url: "/annountCement/list",
    method: "get",
    params,
  });
}
/*
 * 系统通告发布
 */
export function annountCementDoReleaseData(id) {
  return request({
    url: `/annountCement/doReleaseData/${id}`,
    method: "post",
  });
}
/*
 * 系统通告批量删除
 */
export function annountCementDelete(ids) {
  return request({
    url: `/annountCement/delete/${ids}`,
    method: "post",
  });
}
/*
 * 系统通告详情
 */
export function annountCementQueryById(data) {
  return request({
    url: `/annountCement/queryById`,
    method: "post",
    data,
  });
}
/*
 * 系统通告添加
 */
export function annountCementAdd(data) {
  return request({
    url: `/annountCement/add`,
    method: "post",
    data,
  });
}
/*
 * 系统通告编辑
 */
export function annountCementEdit(data) {
  return request({
    url: `/annountCement/edit`,
    method: "post",
    data,
  });
}

// APP版本管理
/*
 * APP版本列表
 */
export function appversionList(params) {
  return request({
    url: "/appversion/list",
    method: "get",
    params,
  });
}
/*
 * APP版本新增
 */
export function appversionSave(data) {
  return request({
    url: "/appversion/save",
    method: "post",
    data,
  });
}
/*
 * APP版本详情
 */
export function appversionInfo(id) {
  return request({
    url: `/appversion/info/${id}`,
    method: "post",
  });
}
/*
 * APP版本编辑
 */
export function appversionUpdate(data) {
  return request({
    url: "/appversion/update",
    method: "post",
    data,
  });
}
/*
 * APP版本删除
 */
export function appversionDelete(data) {
  return request({
    url: "/appversion/delete",
    method: "post",
    data,
  });
}

/*
 * 三端安装包
 */
export function appversionGetIsNewVersion(params) {
  return request({
    url: "/appversion/getIsNewVersion",
    method: "get",
    params,
  });
}

// 轮播图管理
/*
 * 轮播图列表
 */
export function bannerList(data) {
  return request({
    url: "/admin/system/group/data/carousel/list",
    method: "POST",
    data,
  });
}
/*
 * 轮播图详情
 */
export function bannerInfo(params) {
  return request({
    url: "/admin/system/group/data/info",
    method: "get",
    params,
  });
}
// 轮播图新增
export function bannerAdd(data) {
  return request({
    url: "/admin/system/group/data/carousel/saveCarousel",
    method: "POST",
    data,
  });
}
// 轮播图编辑
export function bannerEdit(data, params) {
  return request({
    url: "/admin/system/group/data/updateCarousel",
    method: "POST",
    data,
    params,
  });
}
// 轮播图删除
export function bannerDelete(params) {
  return request({
    url: "/admin/system/group/data/delete",
    method: "get",
    params,
  });
}
